import * as veeValidate   from 'vee-validate'

import * as rules from '@vee-validate/rules'

import { localize  } from '@vee-validate/i18n'

import zh_CN from '@vee-validate/i18n/dist/locale/zh_CN.json'


import yup from './yup'

    // 定义多语言
    veeValidate.configure({
        generateMessage: localize('zh_CN',zh_CN)
    })  



    // 定义验证规则
    Object.keys(rules).forEach((key )=>{
        console.log(typeof rules[key])
        console.log(key)

        if(typeof rules[key]  == 'function'){
       veeValidate.defineRule(key,rules[key])

        }
    })



const modules = {
    yup,
    ...veeValidate
}

   export default modules 